/*
 * @Description:
 * @Author: wangyan
 * @Date: 2021-03-02 14:32:14
 * @LastEditTime: 2021-03-31 18:12:16
 * @LastEditors: @yzcheng
 */
import request from '@/utils/request';
import { getThreeMonths } from "@/utils/currency"
import { CHECC_API_PROCESS } from '@/constants/proxy'

// import { method } from 'lodash';

//分页查询
export function pageHistoryList(pageOption, params = { endTime: new Date().getTime(), startTime: getThreeMonths(), }) {
    return request({
        url: CHECC_API_PROCESS + `/act/task/done?page=${pageOption.pageNum}&size=${pageOption.pageSize}`,
        method: 'get',
        params
    })
}
//流程追踪
export function flowTrackByProcessInstanceId(processInstanceId) {
    return request({
        url: CHECC_API_PROCESS + `/act/task/trace?processInstanceId=${processInstanceId}`,
        method: 'get',
    })
}
//获取用户别名
export function getUserAlias(userList) {
    return request({
        url: CHECC_API_PROCESS + `/user/getCName?${userList ? userList.join('&') : ''}`,
        method: 'get',
    })
}
export function getFlowBpmn(procDefid) {
    return request({
        url: CHECC_API_PROCESS + `/flowFile/queryFileStr?proDefId=${procDefid}`,
        method: 'get',

    })
}
export function getTaskCurrent(processInstanceId) {
    return request({
        url: CHECC_API_PROCESS + `/act/task/current_trace?processInstanceId=${processInstanceId}`,
        method: 'get',
    })
}
export function finishTask(data) {
    return request({
        url: CHECC_API_PROCESS + `/act/task/completeTaskByVo`,
        method: 'post',
        data

    })
}
